﻿namespace Security.Login
{
    using APP.HELPER.Utils.Language;
    using Common;
    using DevExpress.Data;
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.BandedGrid;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using Extra.ERP;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Windows.Forms;

    public class xucSysLog : xucBase
    {
        private Bar bar1;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarButtonItem bbiClear;
        private BarButtonItem bbiClose;
        private BarButtonItem bbiDelete;
        private BarButtonItem bbiExport;
        private BarButtonItem bbiHelp;
        private BarButtonItem bbiHistory;
        private BarButtonItem bbiImport;
        private BarButtonItem bbiOpen;
        private BarButtonItem bbiOtherView;
        private BarButtonItem bbiPrint;
        private BarSubItem bbiProduct;
        private BarButtonItem bbiProductDetail;
        private BarButtonItem bbiRefresh;
        private BarButtonItem bbiSave;
        private BarManager bm;
        private SimpleButton btnCancel;
        private SimpleButton btnStart;
        private BandedGridColumn colAccountWin;
        private BandedGridColumn colAction;
        private BandedGridColumn colAction_Name;
        private BandedGridColumn colActive;
        private BandedGridColumn colCreated;
        private BandedGridColumn colDescription;
        private BandedGridColumn colDeviceName;
        private BandedGridColumn colIPLan;
        private BandedGridColumn colIPWan;
        private BandedGridColumn colMac;
        private BandedGridColumn colMChine;
        private BandedGridColumn colModule;
        private BandedGridColumn colReference;
        private BandedGridColumn colSYS_ID;
        private BandedGridColumn colUserName;
        private IContainer components = null;
        protected DateEdit dtFrom;
        protected DateEdit dtTo;
        private BarEditItem Fromdate;
        protected AdvBandedGridView gbList;
        protected GridControl gcList;
        protected GridBand gridBand1;
        private GridView gridView3;
        private DevExpress.Utils.ImageCollection imageCollection2;
        protected LabelControl lblFrom;
        protected LabelControl lblTo;
        private PanelControl panelControl4;
        private PopupControlContainer pcc;
        private PopupMenu pm;
        private RepositoryItemDateEdit repositoryItemDateEdit1;
        private RepositoryItemDateEdit repositoryItemDateEdit2;
        private GridView repositoryItemGridLookUpEdit1View;
        private RepositoryItemDateEdit rpDate;
        private RepositoryItemGridLookUpEdit rpgProduct;
        private RepositoryItemGridLookUpEdit rpGroup;
        private RepositoryItemComboBox rpType;
        private RepositoryItemCalcEdit rpVal;
        private BarEditItem Todate;

        public xucSysLog()
        {
            this.InitializeComponent();
            this.InitMultiLanguages();
            this.bm.SetPopupContextMenu(this.gcList, this.pm);
            this.Fromdate.EditValue = DateTime.Now;
            this.Todate.EditValue = DateTime.Now;
            this.Init();
        }

        private void bbiClear_ItemClick(object sender, ItemClickEventArgs e)
        {
            DataTable dataSource = this.gcList.DataSource as DataTable;
            SYS_LOG sys_log = new SYS_LOG();
            for (int i = 0; i < dataSource.Rows.Count; i++)
            {
                sys_log.Delete(Convert.ToInt64(dataSource.Rows[i]["SYS_ID"]));
            }
            this.LoadLog();
        }

        private void bbiClose_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (base.ParentForm != null)
            {
                base.ParentForm.Close();
            }
        }

        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            object rowCellValue;
            if (this.gbList.SelectedRowsCount > 0)
            {
                int[] selectedRows = this.gbList.GetSelectedRows();
                for (int i = selectedRows.Length; i > 0; i--)
                {
                    rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "SYS_ID");
                    if (rowCellValue != null)
                    {
                        SYS_LOG sys_log = new SYS_LOG();
                        sys_log.Delete(Convert.ToInt64(rowCellValue));
                    }
                }
            }
            else
            {
                rowCellValue = this.gbList.GetFocusedRowCellValue("SYS_ID");
                if (rowCellValue == null)
                {
                    return;
                }
                new SYS_LOG().Delete(Convert.ToInt64(rowCellValue));
            }
            this.LoadLog();
        }

        private void bbiExport_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.btnExport_Click(sender, e);
        }

        private void bbiOpen_ItemClick(object sender, ItemClickEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog {
                Filter = "Xml File(*.xml)|*.xml|All File(*.*)|*.*"
            };
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                FileInfo info = new FileInfo(dialog.FileName);
                if (info.Exists)
                {
                    DataTable dataSource = this.gcList.DataSource as DataTable;
                    dataSource.TableName = "SYS_LOG";
                    this.gcList.DataSource = dataSource.ReadXml(info.FullName);
                }
            }
        }

        private void bbiOtherView_Popup(object sender, EventArgs e)
        {
        }

        private void bbiRefresh_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.btnView_Click(sender, e);
        }

        private void bbiSave_ItemClick(object sender, ItemClickEventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog {
                Filter = "Xml File(*.xml)|*.xml|All File(*.*)|*.*"
            };
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    DataTable dataSource = this.gcList.DataSource as DataTable;
                    dataSource.TableName = "SYS_LOG";
                    dataSource.WriteXml(dialog.FileName);
                }
                catch (Exception exception)
                {
                    XtraMessageBox.Show("Lỗi:\n\t" + exception.Message, "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.pcc.HidePopup();
        }

        private void btnExport_Click(object sender, EventArgs e)
        {
            base._exportView = this.gbList;
            base.Export();
        }

        private void btnHelp_Click(object sender, EventArgs e)
        {
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            this.LoadLog();
            SYS_LOG sys_log = new SYS_LOG();
            if ((this.gcList.DataSource as DataTable).Rows.Count <= 0)
            {
                XtraMessageBox.Show("Kh\x00f4ng c\x00f3 dữ liệu n\x00e0o trong khoảng thời gian n\x00e0y", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }

        private void btnView_Click(object sender, EventArgs e)
        {
            this.btnStart_Click(sender, e);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Init()
        {
            this.LoadLog();
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucSysLog));
            this.gcList = new GridControl();
            this.gbList = new AdvBandedGridView();
            this.gridBand1 = new GridBand();
            this.colSYS_ID = new BandedGridColumn();
            this.colUserName = new BandedGridColumn();
            this.colMChine = new BandedGridColumn();
            this.colAccountWin = new BandedGridColumn();
            this.colCreated = new BandedGridColumn();
            this.colModule = new BandedGridColumn();
            this.colAction = new BandedGridColumn();
            this.colAction_Name = new BandedGridColumn();
            this.colReference = new BandedGridColumn();
            this.colIPLan = new BandedGridColumn();
            this.colIPWan = new BandedGridColumn();
            this.colMac = new BandedGridColumn();
            this.colDeviceName = new BandedGridColumn();
            this.colDescription = new BandedGridColumn();
            this.colActive = new BandedGridColumn();
            this.rpType = new RepositoryItemComboBox();
            this.rpGroup = new RepositoryItemGridLookUpEdit();
            this.repositoryItemGridLookUpEdit1View = new GridView();
            this.rpVal = new RepositoryItemCalcEdit();
            this.rpDate = new RepositoryItemDateEdit();
            this.rpgProduct = new RepositoryItemGridLookUpEdit();
            this.gridView3 = new GridView();
            this.pcc = new PopupControlContainer(this.components);
            this.btnCancel = new SimpleButton();
            this.dtFrom = new DateEdit();
            this.bm = new BarManager(this.components);
            this.bar1 = new Bar();
            this.Fromdate = new BarEditItem();
            this.repositoryItemDateEdit1 = new RepositoryItemDateEdit();
            this.Todate = new BarEditItem();
            this.repositoryItemDateEdit2 = new RepositoryItemDateEdit();
            this.bbiRefresh = new BarButtonItem();
            this.bbiDelete = new BarButtonItem();
            this.bbiClear = new BarButtonItem();
            this.bbiSave = new BarButtonItem();
            this.bbiOpen = new BarButtonItem();
            this.bbiExport = new BarButtonItem();
            this.bbiHelp = new BarButtonItem();
            this.bbiClose = new BarButtonItem();
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.imageCollection2 = new DevExpress.Utils.ImageCollection(this.components);
            this.bbiPrint = new BarButtonItem();
            this.bbiOtherView = new BarButtonItem();
            this.btnStart = new SimpleButton();
            this.lblFrom = new LabelControl();
            this.dtTo = new DateEdit();
            this.lblTo = new LabelControl();
            this.pm = new PopupMenu(this.components);
            this.panelControl4 = new PanelControl();
            this.gcList.BeginInit();
            this.gbList.BeginInit();
            this.rpType.BeginInit();
            this.rpGroup.BeginInit();
            this.repositoryItemGridLookUpEdit1View.BeginInit();
            this.rpVal.BeginInit();
            this.rpDate.BeginInit();
            this.rpDate.VistaTimeProperties.BeginInit();
            this.rpgProduct.BeginInit();
            this.gridView3.BeginInit();
            this.pcc.BeginInit();
            this.pcc.SuspendLayout();
            this.dtFrom.Properties.VistaTimeProperties.BeginInit();
            this.dtFrom.Properties.BeginInit();
            this.bm.BeginInit();
            this.repositoryItemDateEdit1.BeginInit();
            this.repositoryItemDateEdit1.VistaTimeProperties.BeginInit();
            this.repositoryItemDateEdit2.BeginInit();
            this.repositoryItemDateEdit2.VistaTimeProperties.BeginInit();
            this.imageCollection2.BeginInit();
            this.dtTo.Properties.VistaTimeProperties.BeginInit();
            this.dtTo.Properties.BeginInit();
            this.pm.BeginInit();
            this.panelControl4.BeginInit();
            this.panelControl4.SuspendLayout();
            base.SuspendLayout();
            this.gcList.Dock = DockStyle.Fill;
            this.gcList.Location = new Point(0, 0);
            this.gcList.LookAndFeel.SkinName = "Office 2007 Black";
            this.gcList.MainView = this.gbList;
            this.gcList.Name = "gcList";
            this.gcList.RepositoryItems.AddRange(new RepositoryItem[] { this.rpType, this.rpGroup, this.rpVal, this.rpDate, this.rpgProduct });
            this.gcList.Size = new Size(0x3bc, 0x1fb);
            this.gcList.TabIndex = 15;
            this.gcList.ViewCollection.AddRange(new BaseView[] { this.gbList });
            this.gbList.Appearance.GroupRow.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.gbList.Appearance.GroupRow.Options.UseFont = true;
            this.gbList.AppearancePrint.FilterPanel.Options.UseFont = true;
            this.gbList.AppearancePrint.FilterPanel.Options.UseTextOptions = true;
            this.gbList.AppearancePrint.FilterPanel.TextOptions.Trimming = Trimming.Word;
            this.gbList.Bands.AddRange(new GridBand[] { this.gridBand1 });
            this.gbList.Columns.AddRange(new BandedGridColumn[] { this.colSYS_ID, this.colMChine, this.colCreated, this.colModule, this.colAction, this.colAction_Name, this.colReference, this.colDescription, this.colActive, this.colUserName, this.colAccountWin, this.colIPLan, this.colIPWan, this.colMac, this.colDeviceName });
            this.gbList.CustomizationFormBounds = new Rectangle(0x418, 0x24d, 0xdf, 0xec);
            this.gbList.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gbList.GridControl = this.gcList;
            this.gbList.GroupCount = 2;
            this.gbList.GroupSummary.AddRange(new GridSummaryItem[] { new GridGroupSummaryItem(SummaryItemType.None, "", null, "") });
            this.gbList.Name = "gbList";
            this.gbList.OptionsBehavior.AutoExpandAllGroups = true;
            this.gbList.OptionsBehavior.AutoSelectAllInEditor = false;
            this.gbList.OptionsFilter.ShowAllTableValuesInFilterPopup = true;
            this.gbList.OptionsFilter.UseNewCustomFilterDialog = true;
            this.gbList.OptionsPrint.ExpandAllDetails = true;
            this.gbList.OptionsPrint.PrintDetails = true;
            this.gbList.OptionsPrint.PrintFilterInfo = true;
            this.gbList.OptionsSelection.InvertSelection = true;
            this.gbList.OptionsSelection.MultiSelect = true;
            this.gbList.OptionsView.AnimationType = GridAnimationType.AnimateFocusedItem;
            this.gbList.OptionsView.EnableAppearanceEvenRow = true;
            this.gbList.OptionsView.ShowAutoFilterRow = true;
            this.gbList.OptionsView.ShowBands = false;
            this.gbList.OptionsView.ShowDetailButtons = false;
            this.gbList.OptionsView.ShowGroupPanel = false;
            this.gbList.ShowButtonMode = ShowButtonModeEnum.ShowAlways;
            this.gbList.SortInfo.AddRange(new GridColumnSortInfo[] { new GridColumnSortInfo(this.colMChine, ColumnSortOrder.Ascending), new GridColumnSortInfo(this.colUserName, ColumnSortOrder.Ascending) });
            this.gbList.ViewCaption = "Danh s\x00e1ch Nh\x00e2n vi\x00ean";
            this.gridBand1.Columns.Add(this.colSYS_ID);
            this.gridBand1.Columns.Add(this.colUserName);
            this.gridBand1.Columns.Add(this.colMChine);
            this.gridBand1.Columns.Add(this.colAccountWin);
            this.gridBand1.Columns.Add(this.colCreated);
            this.gridBand1.Columns.Add(this.colModule);
            this.gridBand1.Columns.Add(this.colAction);
            this.gridBand1.Columns.Add(this.colAction_Name);
            this.gridBand1.Columns.Add(this.colReference);
            this.gridBand1.Columns.Add(this.colIPLan);
            this.gridBand1.Columns.Add(this.colIPWan);
            this.gridBand1.Columns.Add(this.colMac);
            this.gridBand1.Columns.Add(this.colDeviceName);
            this.gridBand1.Columns.Add(this.colDescription);
            this.gridBand1.Columns.Add(this.colActive);
            this.gridBand1.MinWidth = 20;
            this.gridBand1.Name = "gridBand1";
            this.gridBand1.OptionsBand.ShowCaption = false;
            this.gridBand1.Width = 0x5a0;
            this.colSYS_ID.Caption = "ID";
            this.colSYS_ID.FieldName = "SYS_ID";
            this.colSYS_ID.Name = "colSYS_ID";
            this.colSYS_ID.OptionsColumn.ReadOnly = true;
            this.colSYS_ID.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colSYS_ID.Width = 80;
            this.colUserName.Caption = "Người D\x00f9ng";
            this.colUserName.FieldName = "UserName";
            this.colUserName.Name = "colUserName";
            this.colUserName.OptionsColumn.ReadOnly = true;
            this.colUserName.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colUserName.Visible = true;
            this.colUserName.Width = 0x67;
            this.colMChine.Caption = "M\x00e1y T\x00ednh";
            this.colMChine.FieldName = "MChine";
            this.colMChine.Name = "colMChine";
            this.colMChine.OptionsColumn.ReadOnly = true;
            this.colMChine.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colMChine.Visible = true;
            this.colMChine.Width = 0x71;
            this.colAccountWin.Caption = "T\x00e0i Khoản";
            this.colAccountWin.FieldName = "AccountWin";
            this.colAccountWin.Name = "colAccountWin";
            this.colAccountWin.OptionsColumn.ReadOnly = true;
            this.colAccountWin.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colAccountWin.Visible = true;
            this.colAccountWin.Width = 0x70;
            this.colCreated.Caption = "Thời Gian";
            this.colCreated.DisplayFormat.FormatString = "{0:dd/MM/yyyy hh:mm:ss}";
            this.colCreated.DisplayFormat.FormatType = FormatType.Custom;
            this.colCreated.FieldName = "Created";
            this.colCreated.Name = "colCreated";
            this.colCreated.OptionsColumn.ReadOnly = true;
            this.colCreated.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colCreated.Visible = true;
            this.colCreated.Width = 150;
            this.colModule.Caption = "Chức Năng";
            this.colModule.FieldName = "Module";
            this.colModule.Name = "colModule";
            this.colModule.OptionsColumn.ReadOnly = true;
            this.colModule.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colModule.Visible = true;
            this.colModule.Width = 100;
            this.colAction.Caption = "T\x00e1c Vụ";
            this.colAction.FieldName = "Action";
            this.colAction.Name = "colAction";
            this.colAction.OptionsColumn.ReadOnly = true;
            this.colAction.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colAction.Width = 80;
            this.colAction_Name.Caption = "H\x00e0nh Động";
            this.colAction_Name.FieldName = "Action_Name";
            this.colAction_Name.Name = "colAction_Name";
            this.colAction_Name.OptionsColumn.ReadOnly = true;
            this.colAction_Name.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colAction_Name.Visible = true;
            this.colAction_Name.Width = 80;
            this.colReference.AutoFillDown = true;
            this.colReference.Caption = "Đối Tượng";
            this.colReference.FieldName = "Reference";
            this.colReference.Name = "colReference";
            this.colReference.OptionsColumn.ReadOnly = true;
            this.colReference.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colReference.ToolTip = "Đối Tượng Chịu T\x00e1c Động Tron H\x00e0nh Động N\x00e0y";
            this.colReference.Visible = true;
            this.colReference.Width = 0x98;
            this.colIPLan.Caption = "IP LAN";
            this.colIPLan.FieldName = "IPLan";
            this.colIPLan.Name = "colIPLan";
            this.colIPLan.OptionsColumn.ReadOnly = true;
            this.colIPLan.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colIPLan.Visible = true;
            this.colIPLan.Width = 90;
            this.colIPWan.Caption = "IP WAN";
            this.colIPWan.FieldName = "IPWan";
            this.colIPWan.Name = "colIPWan";
            this.colIPWan.OptionsColumn.ReadOnly = true;
            this.colIPWan.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colIPWan.Visible = true;
            this.colIPWan.Width = 90;
            this.colMac.Caption = "MAC";
            this.colMac.FieldName = "Mac";
            this.colMac.Name = "colMac";
            this.colMac.OptionsColumn.ReadOnly = true;
            this.colMac.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colMac.Visible = true;
            this.colMac.Width = 150;
            this.colDeviceName.FieldName = "DeviceName";
            this.colDeviceName.Name = "colDeviceName";
            this.colDeviceName.OptionsColumn.ReadOnly = true;
            this.colDeviceName.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colDeviceName.Visible = true;
            this.colDeviceName.Width = 300;
            this.colDescription.Caption = "Ghi Ch\x00fa";
            this.colDescription.FieldName = "Description";
            this.colDescription.Name = "colDescription";
            this.colDescription.OptionsColumn.ReadOnly = true;
            this.colDescription.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.colActive.Caption = "K\x00edch Hoạt";
            this.colActive.FieldName = "Active";
            this.colActive.Name = "colActive";
            this.colActive.OptionsColumn.ReadOnly = true;
            this.colActive.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
            this.rpType.AutoHeight = false;
            this.rpType.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.rpType.Name = "rpType";
            this.rpGroup.AutoHeight = false;
            this.rpGroup.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.rpGroup.DisplayMember = "ProductGroup_ID";
            this.rpGroup.Name = "rpGroup";
            this.rpGroup.ValueMember = "ProductGroup_ID";
            this.rpGroup.View = this.repositoryItemGridLookUpEdit1View;
            this.repositoryItemGridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.repositoryItemGridLookUpEdit1View.Name = "repositoryItemGridLookUpEdit1View";
            this.repositoryItemGridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.repositoryItemGridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.rpVal.AutoHeight = false;
            this.rpVal.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.rpVal.DisplayFormat.FormatString = "{0:##,##0.###}";
            this.rpVal.DisplayFormat.FormatType = FormatType.Custom;
            this.rpVal.EditFormat.FormatString = "{0:##,##0.###}";
            this.rpVal.EditFormat.FormatType = FormatType.Custom;
            this.rpVal.Name = "rpVal";
            this.rpDate.AutoHeight = false;
            this.rpDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.rpDate.DisplayFormat.FormatString = "{0:dd/MM/yyyy}";
            this.rpDate.DisplayFormat.FormatType = FormatType.Custom;
            this.rpDate.EditFormat.FormatString = "{0:dd/MM/yyyy}";
            this.rpDate.EditFormat.FormatType = FormatType.Custom;
            this.rpDate.Name = "rpDate";
            this.rpDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.rpgProduct.AutoComplete = false;
            this.rpgProduct.AutoHeight = false;
            this.rpgProduct.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.rpgProduct.DisplayMember = "Product_Name";
            this.rpgProduct.Name = "rpgProduct";
            this.rpgProduct.NullText = "(Chọn)";
            this.rpgProduct.TextEditStyle = TextEditStyles.Standard;
            this.rpgProduct.ValueMember = "Product_ID";
            this.rpgProduct.View = this.gridView3;
            this.gridView3.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridView3.Name = "gridView3";
            this.gridView3.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridView3.OptionsView.ShowGroupPanel = false;
            this.pcc.Appearance.BackColor = SystemColors.Control;
            this.pcc.Appearance.Options.UseBackColor = true;
            this.pcc.BorderStyle = BorderStyles.NoBorder;
            this.pcc.Controls.Add(this.btnCancel);
            this.pcc.Controls.Add(this.dtFrom);
            this.pcc.Controls.Add(this.btnStart);
            this.pcc.Controls.Add(this.lblFrom);
            this.pcc.Controls.Add(this.dtTo);
            this.pcc.Controls.Add(this.lblTo);
            this.pcc.Location = new Point(0x67, 0xa3);
            this.pcc.Name = "pcc";
            this.pcc.Padding = new Padding(4);
            this.pcc.Size = new Size(190, 0x5f);
            this.pcc.TabIndex = 0x11;
            this.pcc.Visible = false;
            this.btnCancel.Image = (Image) manager.GetObject("btnCancel.Image");
            this.btnCancel.Location = new Point(0x66, 0x3f);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(80, 0x19);
            this.btnCancel.TabIndex = 0xf1;
            this.btnCancel.Text = "Đ\x00f3ng";
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.dtFrom.EditValue = new DateTime(0x7d9, 7, 0x19, 0x16, 0x39, 0x2e, 0x213);
            this.dtFrom.Location = new Point(0x3b, 7);
            this.dtFrom.MenuManager = this.bm;
            this.dtFrom.Name = "dtFrom";
            this.dtFrom.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtFrom.Properties.DisplayFormat.FormatString = "{0:dd/MM/yyyy}";
            this.dtFrom.Properties.DisplayFormat.FormatType = FormatType.Custom;
            this.dtFrom.Properties.EditFormat.FormatString = "{0:dd/MM/yyyy}";
            this.dtFrom.Properties.EditFormat.FormatType = FormatType.Custom;
            this.dtFrom.Properties.EditValueChangedFiringMode = EditValueChangedFiringMode.Buffered;
            this.dtFrom.Properties.ExportMode = ExportMode.Value;
            this.dtFrom.Properties.Mask.EditMask = "dd/MM/yyyy";
            this.dtFrom.Properties.VistaDisplayMode = DefaultBoolean.True;
            this.dtFrom.Properties.VistaEditTime = DefaultBoolean.False;
            this.dtFrom.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtFrom.Size = new Size(0x7b, 20);
            this.dtFrom.TabIndex = 0xee;
            this.bm.AutoSaveInRegistry = true;
            this.bm.Bars.AddRange(new Bar[] { this.bar1 });
            this.bm.DockControls.Add(this.barDockControlTop);
            this.bm.DockControls.Add(this.barDockControlBottom);
            this.bm.DockControls.Add(this.barDockControlLeft);
            this.bm.DockControls.Add(this.barDockControlRight);
            this.bm.Form = this;
            this.bm.Images = this.imageCollection2;
            this.bm.Items.AddRange(new BarItem[] { this.bbiPrint, this.bbiRefresh, this.bbiExport, this.bbiHelp, this.bbiClose, this.bbiOtherView, this.bbiDelete, this.bbiClear, this.bbiSave, this.bbiOpen, this.Fromdate, this.Todate });
            this.bm.MaxItemId = 0x1f;
            this.bm.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemDateEdit1, this.repositoryItemDateEdit2 });
            this.bar1.BarName = "Custom 2";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = BarDockStyle.Top;
            this.bar1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.Fromdate, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.Todate, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiRefresh, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiDelete, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiClear, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiSave, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiOpen, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiExport, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiHelp, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiClose, BarItemPaintStyle.CaptionGlyph) });
            this.bar1.OptionsBar.UseWholeRow = true;
            this.bar1.Text = "Custom 2";
            this.Fromdate.Caption = "Từ Ng\x00e0y:";
            this.Fromdate.Edit = this.repositoryItemDateEdit1;
            this.Fromdate.Id = 0x1d;
            this.Fromdate.Name = "Fromdate";
            this.Fromdate.Width = 80;
            this.repositoryItemDateEdit1.AutoHeight = false;
            this.repositoryItemDateEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemDateEdit1.Name = "repositoryItemDateEdit1";
            this.repositoryItemDateEdit1.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.Todate.Caption = "Đến Ng\x00e0y:";
            this.Todate.Edit = this.repositoryItemDateEdit2;
            this.Todate.Id = 30;
            this.Todate.Name = "Todate";
            this.Todate.Width = 80;
            this.repositoryItemDateEdit2.AutoHeight = false;
            this.repositoryItemDateEdit2.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemDateEdit2.Name = "repositoryItemDateEdit2";
            this.repositoryItemDateEdit2.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.bbiRefresh.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.bbiRefresh.Appearance.Options.UseFont = true;
            this.bbiRefresh.Caption = "Xem";
            this.bbiRefresh.Id = 4;
            this.bbiRefresh.ImageIndex = 0x23;
            this.bbiRefresh.Name = "bbiRefresh";
            this.bbiRefresh.ItemClick += new ItemClickEventHandler(this.bbiRefresh_ItemClick);
            this.bbiDelete.Caption = "Xo\x00e1";
            this.bbiDelete.Id = 0x19;
            this.bbiDelete.ImageIndex = 4;
            this.bbiDelete.Name = "bbiDelete";
            this.bbiDelete.ItemClick += new ItemClickEventHandler(this.bbiDelete_ItemClick);
            this.bbiClear.Caption = "Dọn Sạch";
            this.bbiClear.Id = 0x1a;
            this.bbiClear.ImageIndex = 0x26;
            this.bbiClear.Name = "bbiClear";
            this.bbiClear.ItemClick += new ItemClickEventHandler(this.bbiClear_ItemClick);
            this.bbiSave.Caption = "Lưu Nhật K\x00fd";
            this.bbiSave.Id = 0x1b;
            this.bbiSave.ImageIndex = 1;
            this.bbiSave.Name = "bbiSave";
            this.bbiSave.ItemClick += new ItemClickEventHandler(this.bbiSave_ItemClick);
            this.bbiOpen.Caption = "Nạp Nhật K\x00fd Từ Tập Tin...";
            this.bbiOpen.Id = 0x1c;
            this.bbiOpen.ImageIndex = 2;
            this.bbiOpen.Name = "bbiOpen";
            this.bbiOpen.ItemClick += new ItemClickEventHandler(this.bbiOpen_ItemClick);
            this.bbiExport.Caption = "Xuất";
            this.bbiExport.Id = 5;
            this.bbiExport.ImageIndex = 0x25;
            this.bbiExport.LargeImageIndex = 0x13;
            this.bbiExport.Name = "bbiExport";
            this.bbiExport.ItemClick += new ItemClickEventHandler(this.bbiExport_ItemClick);
            this.bbiHelp.Caption = "Trợ Gi\x00fap";
            this.bbiHelp.Id = 6;
            this.bbiHelp.ImageIndex = 0x10;
            this.bbiHelp.Name = "bbiHelp";
            this.bbiClose.Caption = "Đ\x00f3ng";
            this.bbiClose.Id = 10;
            this.bbiClose.ImageIndex = 13;
            this.bbiClose.LargeImageIndex = 1;
            this.bbiClose.Name = "bbiClose";
            this.bbiClose.ItemClick += new ItemClickEventHandler(this.bbiClose_ItemClick);
            this.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.imageCollection2.Images.SetKeyName(0x24, "reload321.png");
            this.imageCollection2.Images.SetKeyName(0x25, "Xuat.png");
            this.imageCollection2.Images.SetKeyName(0x26, "Vista (133).ico");
            this.bbiPrint.Caption = "In";
            this.bbiPrint.Id = 3;
            this.bbiPrint.ImageIndex = 9;
            this.bbiPrint.Name = "bbiPrint";
            this.bbiOtherView.ButtonStyle = BarButtonStyle.DropDown;
            this.bbiOtherView.Caption = "Xem Kh\x00e1c...";
            this.bbiOtherView.DropDownControl = this.pcc;
            this.bbiOtherView.Id = 0x18;
            this.bbiOtherView.Name = "bbiOtherView";
            this.btnStart.Image = (Image) manager.GetObject("btnStart.Image");
            this.btnStart.Location = new Point(0x10, 0x3f);
            this.btnStart.Name = "btnStart";
            this.btnStart.Size = new Size(80, 0x19);
            this.btnStart.TabIndex = 240;
            this.btnStart.Text = "Thực Hiện";
            this.btnStart.Click += new EventHandler(this.btnStart_Click);
            this.lblFrom.Location = new Point(4, 11);
            this.lblFrom.Name = "lblFrom";
            this.lblFrom.Size = new Size(40, 13);
            this.lblFrom.TabIndex = 0xec;
            this.lblFrom.Text = "Từ ng\x00e0y";
            this.dtTo.EditValue = new DateTime(0x7d9, 7, 0x19, 0x16, 0x39, 0x2e, 0x213);
            this.dtTo.Location = new Point(0x3b, 0x21);
            this.dtTo.MenuManager = this.bm;
            this.dtTo.Name = "dtTo";
            this.dtTo.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtTo.Properties.DisplayFormat.FormatString = "{0:dd/MM/yyyy}";
            this.dtTo.Properties.DisplayFormat.FormatType = FormatType.Custom;
            this.dtTo.Properties.EditFormat.FormatString = "{0:dd/MM/yyyy}";
            this.dtTo.Properties.EditFormat.FormatType = FormatType.Custom;
            this.dtTo.Properties.EditValueChangedFiringMode = EditValueChangedFiringMode.Buffered;
            this.dtTo.Properties.ExportMode = ExportMode.Value;
            this.dtTo.Properties.Mask.EditMask = "dd/MM/yyyy";
            this.dtTo.Properties.VistaDisplayMode = DefaultBoolean.True;
            this.dtTo.Properties.VistaEditTime = DefaultBoolean.False;
            this.dtTo.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtTo.Size = new Size(0x7b, 20);
            this.dtTo.TabIndex = 0xef;
            this.lblTo.Location = new Point(5, 0x25);
            this.lblTo.Name = "lblTo";
            this.lblTo.Size = new Size(0x30, 13);
            this.lblTo.TabIndex = 0xed;
            this.lblTo.Text = "Đến Ng\x00e0y";
            this.pm.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.bbiRefresh, true), new LinkPersistInfo(this.bbiOtherView), new LinkPersistInfo(this.bbiDelete, true), new LinkPersistInfo(this.bbiClear), new LinkPersistInfo(this.bbiSave, true), new LinkPersistInfo(this.bbiOpen), new LinkPersistInfo(this.bbiExport, true), new LinkPersistInfo(this.bbiHelp, true), new LinkPersistInfo(this.bbiClose, true) });
            this.pm.Manager = this.bm;
            this.pm.Name = "pm";
            this.panelControl4.BorderStyle = BorderStyles.NoBorder;
            this.panelControl4.Controls.Add(this.gcList);
            this.panelControl4.Dock = DockStyle.Fill;
            this.panelControl4.Location = new Point(0, 0x1a);
            this.panelControl4.Name = "panelControl4";
            this.panelControl4.Size = new Size(0x3bc, 0x1fb);
            this.panelControl4.TabIndex = 0x12;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.panelControl4);
            base.Controls.Add(this.pcc);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xucSysLog";
            base.Size = new Size(0x3bc, 0x215);
            this.gcList.EndInit();
            this.gbList.EndInit();
            this.rpType.EndInit();
            this.rpGroup.EndInit();
            this.repositoryItemGridLookUpEdit1View.EndInit();
            this.rpVal.EndInit();
            this.rpDate.VistaTimeProperties.EndInit();
            this.rpDate.EndInit();
            this.rpgProduct.EndInit();
            this.gridView3.EndInit();
            this.pcc.EndInit();
            this.pcc.ResumeLayout(false);
            this.pcc.PerformLayout();
            this.dtFrom.Properties.VistaTimeProperties.EndInit();
            this.dtFrom.Properties.EndInit();
            this.bm.EndInit();
            this.repositoryItemDateEdit1.VistaTimeProperties.EndInit();
            this.repositoryItemDateEdit1.EndInit();
            this.repositoryItemDateEdit2.VistaTimeProperties.EndInit();
            this.repositoryItemDateEdit2.EndInit();
            this.imageCollection2.EndInit();
            this.dtTo.Properties.VistaTimeProperties.EndInit();
            this.dtTo.Properties.EndInit();
            this.pm.EndInit();
            this.panelControl4.EndInit();
            this.panelControl4.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void InitMultiLanguages()
        {
            this.Fromdate.Caption = MultiLanguages.GetString("tbl_SysLog", "FromDate", this.Fromdate.Caption);
            this.Todate.Caption = MultiLanguages.GetString("tbl_SysLog", "ToDate", this.Todate.Caption);
            this.bbiRefresh.Caption = MultiLanguages.GetString("tbl_SysLog", "View", this.bbiRefresh.Caption);
            this.bbiDelete.Caption = MultiLanguages.GetString("tbl_SysLog", "Delete", this.bbiDelete.Caption);
            this.bbiClear.Caption = MultiLanguages.GetString("tbl_SysLog", "Empty", this.bbiClear.Caption);
            this.bbiExport.Caption = MultiLanguages.GetString("tbl_SysLog", "Export", this.bbiExport.Caption);
            this.bbiHelp.Caption = MultiLanguages.GetString("tbl_SysLog", "Help", this.bbiHelp.Caption);
            this.bbiSave.Caption = MultiLanguages.GetString("tbl_SysLog", "SaveLog", this.bbiSave.Caption);
            this.bbiOpen.Caption = MultiLanguages.GetString("tbl_SysLog", "LoadLogFromFile", this.bbiOpen.Caption);
            this.bbiClose.Caption = MultiLanguages.GetString("tbl_SysLog", "Close", this.bbiClose.Caption);
            this.colUserName.Caption = MultiLanguages.GetString("tbl_SysLog", "UserName", this.colUserName.Caption);
            this.colAccountWin.Caption = MultiLanguages.GetString("tbl_SysLog", "AccountName", this.colAccountWin.Caption);
            this.colMChine.Caption = MultiLanguages.GetString("tbl_SysLog", "ComputerName", this.colMChine.Caption);
            this.colAction_Name.Caption = MultiLanguages.GetString("tbl_SysLog", "Action", this.colAction_Name.Caption);
            this.colModule.Caption = MultiLanguages.GetString("tbl_SysLog", "Module", this.colModule.Caption);
            this.colCreated.Caption = MultiLanguages.GetString("tbl_SysLog", "Time", this.colCreated.Caption);
            this.colReference.Caption = MultiLanguages.GetString("tbl_SysLog", "Reference", this.colReference.Caption);
            this.colDeviceName.Caption = MultiLanguages.GetString("tbl_SysLog", "DeviceName", this.colDeviceName.Caption);
        }

        private void LoadLog()
        {
            this.gcList.DataSource = new SYS_LOG().GetList(Convert.ToDateTime(this.Fromdate.EditValue.ToString()), Convert.ToDateTime(this.Todate.EditValue.ToString()));
        }
    }
}

